import request from '@/utils/request'
import { url } from '../../build/config'
import ajax from './ajax'

const base_url = url.base_url + '/api/user';

export function login(data) {
  return ajax({
    url: `${base_url}/login`,
    method: 'post',
    ContentType: 'application/x-www-form-urlencoded',
    data: data,
  })
}

export function getInfo() {
  return ajax({
    url: `${base_url}`,
    method: 'get',
  })
}

export function logout() {
  return ajax({
    url: `${base_url}/logout`,
    method: 'post',
  })
}

export function userSave(data) {
  return ajax({
    url: `${base_url}`,
    method: 'post',
    data: data,
    showMsg: true,
  })
}
